import java.util.Scanner;

public class Demo2 {
    public static int func(int m,int n) {
        int number = m;
        if(m > n) {
            number = n;
        }

        while(number != 0) {
            if(m % number == 0 && n % number == 0) {
                return number;
            }
            number--;
        }

        return 0;
    }


    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        while(scan.hasNextInt()) {
            int n = scan.nextInt();
            int a = scan.nextInt();
            int[] array = new int[n];

            for(int i = 0; i < n; i++) {
                array[i] = scan.nextInt();
            }

            for(int i = 0; i < n; i++){
                if(array[i] <= a) {
                    a += array[i];
                }else {
                    a += func(a,array[i]);
                }
            }

            System.out.println(a);
        }
    }
}
